my_dict = {"王力宏": 99, "周杰伦": 88, "林俊杰": 77}
print(my_dict['王力宏'])
print(my_dict['周杰伦'])
print(my_dict['林俊杰'])
dict2 = {"语文": 99, "数学": 96, "英语": 66}
dict1 = {"王力宏": {
    "语文": 77,
    "数学": 66,
    "英语": 33},
    "周杰伦": {
    "语文": 88,
    "数学": 86,
    "英语": 55},
    "林俊杰":
    {"语文": 99,
     "数学": 96,
     "英语": 66
     }
}
print(dict1["王力宏"]["语文"])
print(dict1["周杰伦"]["数学"])
print(dict1["林俊杰"]["英语"])
my_dict = {"王力宏": 99, "周杰伦": 88, "林俊杰": 77}
#  修改
my_dict["王力宏"] = 97
#  更新
my_dict["张学友"] = 90
print(my_dict)
a = my_dict.pop("周杰伦")
print(a, my_dict)
my_dict.clear()
print(my_dict)
my_dict = {"王力宏": 99, "周杰伦": 88, "林俊杰": 77}
b = my_dict.keys()
print(b)
#  遍历字典
for x in b:
    print(f"字典的keys是{x}")
    print(f"key对应的值是{my_dict[x]}")
for x in my_dict:
    print(f"字典2的keys是{x}")
    print(f"key2对应的值是{my_dict[x]}")
#  字典作业
dict3 = {
    "王力宏": {"部门": '科技部', "工资": 3000, "级别": 1},
    "周杰伦": {"部门": '市场部', "工资": 5000, "级别": 2},
    "林俊杰": {"部门": '市场部', "工资": 7000, "级别": 3},
    "张学友": {"部门": '科技部', "工资": 4000, "级别": 1},
    "刘德华": {"部门": '市场部', "工资": 6000, "级别": 2}
}
for money in dict3:
    if dict3[money]["级别"] == 1:
        dict3[money]["级别"] += 1
        dict3[money]["工资"] += 1000
print(f"对全体级别为1的员工完成升职加薪操作，操作后：{dict3}")
#  数据容器通用操作
#  三个函数
# len(),max(),min()
my_list = [1, 2, 3, 4, 5]
my_tuple = (1, 2, 3, 4, 5)
my_str = "abcdefg"
my_set = {5, 4, 1, 2, 3}
my_dict1 = {"key1": 1, "key2": 2, "key3": 3, "key4": 4, "key5": 5}
print(max(my_list))
print(max(my_tuple))
print(max(my_str))
print(max(my_set))
print(max(my_dict1))
print(max(my_list))
print(sorted(my_set, reverse=True))
# 字符串的比较
print({"abc" > "abd"})

